package com.work.cloudseata.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "permission-service")
public interface PermissionService {

    @PostMapping("/permission/bind-default-role")
    void bindDefaultRole(@RequestParam Long userId);

    @GetMapping("/permission/get-role-code")
    String getUserRoleCode(@RequestParam Long userId);

    @PostMapping("/permission/upgrade-to-admin")
    void upgradeToAdmin(@RequestParam Long userId);

    @PostMapping("/permission/downgrade-to-user")
    void downgradeToUser(@RequestParam Long userId);

    @GetMapping("/permission/role-user-list")
    List<Long> roleUserList();
}
